package cn.edu.hit.education.contentprovider;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

import cn.edu.hit.education.model.Node;

public class DepartmentContentProvider implements ITreeContentProvider {
	@Override
	public Object[] getChildren(Object parentElement) {
		return ((Node) parentElement).getChildren().toArray();
	}

	@Override
	public Object getParent(Object element) {
		return ((Node) element).getParent();
	}

	@Override
	public boolean hasChildren(Object element) {
		return (((Node) element).getChildren().size() > 0);
	}

	@Override
	public Object[] getElements(Object inputElement) {
		return ((Node) inputElement).getChildren().toArray();
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
	}

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
		// TODO Auto-generated method stub
	}

}
